package com.tiancheng.trade.payment.mapper;

import com.tiancheng.trade.payment.model.QrFlow;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

/**
 * 二维码支付持久化接口
 */
@Repository
public interface QrFlowMapper extends TYBaseMapper<QrFlow> {
    /**
     * 更新退款信息
     *
     * @param refundAmount 退款金额
     * @param flowId  流水号
     * @return int
     */
    @Update("update qr_flow set refund_amount = refund_amount + #{refundAmount},trade_status=#{tradeStatus},update_time=NOW() where flow_id = #{flowId}")
    int refund(@Param("refundAmount") int refundAmount,@Param("flowId") String flowId,@Param("tradeStatus")int tradeStatus);
}
